<!-- inc:frame.top -->

<!-- if($act=="add" || $act=="modify") -->
<div class="position"><p><!-- inc:position --> &raquo; 其他管理 &raquo; <a href="{:$mainlink}?file=link&act=list">友情链接</a><!-- if($act=="add") --> &raquo; 添加友情链接<!-- elseif($act=="modify") --> &raquo; 编辑友情链接<!-- end --></p><!-- inc:position.fr --></div>

<div class="page_pad">
  <form method="post" action="{:$mainlink}?file=link&act=setok" onsubmit="return add_msg(this);">
  <input type="hidden" name="id" id="id" value="{:$id}" />
  <div class="content_box">
    <div class="content_bor">
      <table class="ctable">
        <tr>
          <td class="left">网站中文名：<span style="color:red;">*</span></td>
          <td class="right"><input class="ginput" type="text" name="name" id="name" value="{:$rs[name]}" /></td>
        </tr>
        <tr {if($system["english"]!="on")}style="display:none;"{end}>
          <td class="left">网站英文名：</td>
          <td class="right"><input class="ginput" type="text" name="name_en" id="name_en" value="{:$rs[name_en]}" /></td>
        </tr>
        <tr>
          <td class="left">网址：<span style="color:red;">*</span></td>
          <td class="right">
            <input class="ginput" type="text" name="linkurl" id="linkurl" value="{:$rs[url]}" />
            &nbsp;
            <span>[请填写目标地址，注意要加http://]</span>
          </td>
        </tr>
        <tr>
          <td class="left">图片：</td>
          <td class="right">
            <input class="ginput" style="width:240px;" type="text" name="picture" id="picture" value="{:$rs[picture]}" />
            &nbsp;
            <button class="gbutton" type="button" onclick="to_openpic('picture')">选择图片</button>
            &nbsp;
            <span>[填写图片地址，使用文字链接请为空]</span>
          </td>
        </tr>
        <tr>
          <td class="left">排序：</td>
          <td class="right">
            <input class="ginput" type="text" name="taxis" id="taxis" value="{:$rs[taxis]}" />
            &nbsp;
            <span>[最大值255，值越小越往前靠]</span>
          </td>
        </tr>
      </table>
    </div>
  </div><!--content_box-->
  
  <div class="gbutton_div"><button type="submit" class="gbutton gbutton_dblue gbutton_add" id="creat_button">保存</button> &nbsp; <button type="button" class="gbutton gbutton_add" onclick="qgurl('{:$mainlink}?file=link&act=list')">返回</button> &nbsp; <span id="show_step" style="color:red;"><img src="images/loading.gif" style="visibility:hidden;" /></span></div>
  </form>
</div><!--page_pad-->

<script type="text/javascript">
function add_msg(o)
{
	if(!o.name.value)
	{
		tip_msg('名称不允许为空');
		return false;
	}
	if(!o.linkurl.value)
	{
		tip_msg('网址不允许为空');
		return false;
	}
	document.getElementById("show_step").innerHTML = "<img src='images/loading.gif' border='0' align='absmiddle'> 正在保存数据，如果网页没有动静请刷新...";
	document.getElementById("creat_button").disabled=true;
}
function to_openpic(id)
{
	var siteurl = "{:$mainlink}?file=open.index.img&act=list&id="+id;
	qg_open(siteurl,"550");
}
</script>

<!-- else -->
<div class="position"><p><!-- inc:position --> &raquo; 其他管理 &raquo; 友情链接</p><!-- inc:position.fr --></div>

<div class="page_pad">
  <div class="content_add"><button class="gbutton gbutton_dblue gbutton_add" type="button" onclick="qgurl('{:$mainlink}?file=link&act=add')">添加友情链接</button></div>

  <div class="content_box">
    <div class="content_bor">
      <table class="ltable">
        <tr class="first">
          <td>网站名称</td>
          <td>网站地址</td>
          <td>排序</td>
          <td width="220">操作</td>
        </tr>
        <!-- $msglist AS $key=>$value -->
        <tr>
          <td><span class="msg_attr">&nbsp;[ID:{:$value[id]}]</span><a href="{:$mainlink}?file=link&act=modify&id={:$value[id]}">&nbsp;{:$value[name]}</a></td>
          <td><a href="{:$value[url]}" target="_blank">{:$value[url]}</a></td>
          <td>{:$value[taxis]}</td>
          <td>
            <button class="gbutton" type="button" onclick="qg_modify({:$value[id]})">编辑</button>
            <button class="gbutton" type="button" onclick="qg_delete({:$value[id]})">删除</button>
          </td>
        </tr>
        <!-- end -->
      </table>
    </div>
  </div><!--content_box-->
</div><!--page_pad-->

<script type="text/javascript">
function qg_modify(id)
{
	qgurl("{:$mainlink}?file=link&act=modify&id="+id);
}
function qg_delete(id)
{
	//判断是否删除	
	url = "{:$mainlink}?file=link&act=delete&id="+id;
	tip_confirm("确认删除该信息吗？特别说明，删除后无法恢复！",url);
}
</script>
<!-- end -->

<!-- inc:frame.bottom -->